# build_executable.py
import os
import PyInstaller.__main__

def build_executable():
    script_name = "ovcam.py"
    executable_name = "ovcam"
    
    # PyInstaller configuration
    PyInstaller.__main__.run([
        script_name,
        '--onefile',  # Create single file executable
        '--clean',     # Clean build files
        '--name=%s' % executable_name,
        '--icon=app.ico'  # Optional: add an icon file
    ])

if __name__ == '__main__':
    build_executable()